import React from 'react';

export class CtrlForm extends React.Component {
  constructor() {
    super();
    this.state = {
      inputValue: 'inputValue',
    };
  }

  inputHandler = (e) => {
    // 修改state
    console.log(e.target.value);
    this.setState({
      inputValue: e.target.value,
    });
  };

  render() {
    return (
      <div>
        <input
          type={'text'}
          value={this.state.inputValue}
          onChange={this.inputHandler}
        />
      </div>
    );
  }
}
